package com.mscsoft;

import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.util.Properties;

import com.mscsoft.ui.Main;

import javafx.application.Application;

public class App {
    public static final Properties properties = new Properties();
    private static int resolutionX;// 横向分辨率
    private static int resolutionY;// 纵向分辨率
    private static boolean offline;// 离线模式
    static {
        try {
            properties.load(new InputStreamReader(App.class.getClassLoader().getResourceAsStream("config.properties"),
                    StandardCharsets.UTF_8));
            resolutionX = Integer.parseInt((String) App.properties.get("resolutionX"));// 横向分辨率
            resolutionY = Integer.parseInt((String) App.properties.get("resolutionY"));// 纵向分辨率
            offline = Boolean.parseBoolean((String) App.properties.get("offline"));
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public static int getResolutionX() {
        return resolutionX;
    }

    public static int getResolutionY() {
        return resolutionY;
    }

    public static boolean getOffline() {
        return offline;
    }

    public static void setOffline(boolean offline) {
        App.offline = offline;
    }

    public static void main(String[] args) {
        Application.launch(Main.class, args);
    }
}
